package data.platform.store;

import data.platform.common.service.command.KeyValueRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.util.function.Tuple2;

import javax.annotation.PostConstruct;

@Slf4j
@ConditionalOnProperty(prefix = "checkpoint", name = "store", havingValue = "memory")
@Repository
public class MemoryRepositoryImpl implements KeyValueRepository<String, byte[]> {

    @PostConstruct
    public void init() {
        log.info("disable rocksdb.........");
    }

    @Override
    public Mono<byte[]> get(String key) {
        return Mono.empty();
    }

    @Override
    public void put(String key, byte[] value) {
    }

    @Override
    public void delete(String key) {
    }

    @Override
    public Flux<Tuple2<String, byte[]>> getByPrefixKey(String prefixKey) {
        return Flux.empty();
    }
}
